﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Web4Comment.Service
{
    public interface ICommentService
    {
        /// <summary>
        /// 评论新闻
        /// </summary>
        /// <param name="username">用户</param>
        /// <param name="url">新闻url</param>
        /// <param name="comments">评论内容</param>
        /// <returns></returns>
        int commentNews(string username, string url, string comments);

        /// <summary>
        /// 评论用户评论(回复)
        /// </summary>
        /// <param name="username">用户</param>
        /// <param name="commentaryId">被回复的评论id</param>
        /// <param name="url">新闻url</param>
        /// <param name="comments">评论内容</param>
        /// <returns></returns>
        int commentCommentary(string username, string url, int commentaryId, string comments);


        //考虑是否实现
        /// <summary>
        /// 推荐评论
        /// </summary>
        /// <param name="fromId">推荐者id</param>
        /// <param name="toId">被推荐者id</param>
        /// <param name="commentaryId">评论id</param>
        /// <returns></returns>
        int recommendCommentary(int fromId, int toId, int commentaryId);

        /// <summary>
        /// 获取新闻的评论(同时获取回复)
        /// </summary>
        /// <param name="newsUrl">新闻URL</param>
        /// <returns></returns>
        List<UnlessComment.Model.CommentDetail> getNewsComments(string newsUrl);

        /// <summary>
        /// 获得我的评论
        /// </summary>
        /// <param name="myId"></param>
        /// <returns></returns>
        List<UnlessComment.Model.CommentDetail> getMyComments(int myId);

        /// <summary>
        /// 获得我的好友的评论
        /// </summary>
        /// <param name="myId"></param>
        /// <returns></returns>
        List<UnlessComment.Model.CommentDetail> getFriendComments(int myId);
    }
}
